package mylooks.greenteam.Registration;

import java.util.ArrayList;
import java.util.List;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class RegistrationAdapter extends FragmentPagerAdapter 
{
	List<Fragment> registration_fragment_list;
	FragmentNamePic fr_name_pic;
	FragmentGender fr_gender;
	FragmentBirthdate fr_birth;

	public RegistrationAdapter(FragmentManager fm) 
	{
		super(fm);
		
		fr_name_pic = new FragmentNamePic();
		fr_gender = new FragmentGender();
		fr_birth = new FragmentBirthdate();
		
		registration_fragment_list = new ArrayList<Fragment>();
		
		registration_fragment_list.add(fr_name_pic);
		registration_fragment_list.add(fr_gender);
		registration_fragment_list.add(fr_birth);
	}

	@Override
	public Fragment getItem(int index) 
	{
		return registration_fragment_list.get(index);
	}

	@Override
	public int getCount() 
	{
		return registration_fragment_list.size();
	}
	
	public User getUser()
	{
		return new User(fr_name_pic.GetName(), fr_name_pic.GetSurname(), fr_birth.GetBirthDate(), fr_gender.GetGender());
	}
}
